import { S } from '../../s';
import { IPSAppCounterRef } from '../../app/control/ipsapp-counter-ref';
import { PSAjaxControlContainerImpl } from '../psajax-control-container-impl';
import { IPSExpBar } from './ipsexp-bar';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysImage } from '../../res/ipssys-image';

export class PSExpBarImpl
  extends PSAjaxControlContainerImpl
  implements IPSExpBar
{
  protected psappcounterref: IPSAppCounterRef;
  getPSAppCounterRef(): IPSAppCounterRef | null {
    return (
      this.psappcounterref ||
      (this.psappcounterref = this.fillObjectModel(
        S._9d,
        this.M.getPSAppCounterRef,
        S._2a9,
      ) as IPSAppCounterRef)
    );
  }

  protected pssysimage: IPSSysImage;
  getPSSysImage(): IPSSysImage | null {
    return (
      this.pssysimage ||
      (this.pssysimage = this.fillObjectModel(
        S._27b,
        this.M.getPSSysImage,
        S._2ad,
      ) as IPSSysImage)
    );
  }

  get title(): string {
    return this.M.title;
  }

  protected titlepslanguageres: IPSLanguageRes;
  getTitlePSLanguageRes(): IPSLanguageRes | null {
    return (
      this.titlepslanguageres ||
      (this.titlepslanguageres = this.fillObjectModel(
        S._276,
        this.M.getTitlePSLanguageRes,
        S._2b1,
      ) as IPSLanguageRes)
    );
  }

  get xDataControlName(): string {
    return this.M.xDataControlName;
  }

  get enableCounter(): boolean {
    return this.M.enableCounter;
  }

  get enableSearch(): boolean {
    return this.M.enableSearch;
  }

  get showTitleBar(): boolean {
    return this.M.showTitleBar;
  }
  get cls(): string {
    return 'PSExpBarImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._233) return true;
    return super.instanceof(cls);
  }
}
